home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / allfiles / angry / intro.dir / 00003_Script_cursorLoop < prev    next >
Text File  |  1999-03-01  |  3KB  |  132 lines

  1. global oldMouseP
  2. global drops
  3. global cursorSpr
  4. global animate
  5. global gravite
  6.  
  7. on enterFrame
  8.   
  9.   if not(soundBusy(1)) then puppetSound 1, member "fuckhead"
  10.   
  11.   if the mouseV > 400 then
  12.     if the member of sprite(7) <> member "navbarupLonger" then
  13.       set the member of sprite(7) = member "navbarupLonger"
  14.       set the loc of sprite 7 to point(320, 491)
  15.     end if
  16.     
  17.     if the mouseH < 80 then
  18.       set the member of sprite(5) to member "QuitON"
  19.     else if the mouseH > 550 then
  20.       set the member of sprite(6) to member "creditsON"
  21.     else
  22.       set the member of sprite(5) to "QuitOFF"
  23.       set the member of sprite(6) to "creditsOFF"
  24.     end if
  25.     
  26.   else
  27.     if the member of sprite(7) <> member "navBarDOWNLonger" AND the member of sprite(7) <> member "infobarON" then
  28.       set the member of sprite(7) to member "navBarDOWNLonger"
  29.       set the loc of sprite 7 to point(320, 491)
  30.       set the member of sprite(5) to "QuitOFF"
  31.       set the member of sprite(6) to "creditsOFF"
  32.     end if
  33.   end if
  34.   
  35.   
  36.   -- main cursor
  37.   
  38.   set mouseP = point(the mouseH, the mouseV)
  39.   
  40.   if inside(mouseP, rect(0, 0, 640, 480)) then cursor 200
  41.   else cursor -1
  42.   
  43.   set diffP = mouseP - oldMouseP
  44.   
  45.   set horiz = getAt(diffP, 1)
  46.   set vert = getAt(diffP, 2)
  47.   
  48.   set drop = TRUE
  49.   
  50.   if horiz < -5 then
  51.     
  52.     if vert < -5 then
  53.       set the member of sprite(cursorSpr) to member "northwest"
  54.     else if vert > 5 then
  55.       set the member of sprite(cursorSpr) to member "southwest"
  56.     else
  57.       set the member of sprite(cursorSpr) to member "west"
  58.     end if
  59.     
  60.   else if horiz > 5 then
  61.     
  62.     if vert < -5 then
  63.       set the member of sprite(cursorSpr) to member "northeast"
  64.     else if vert > 5 then
  65.       set the member of sprite(cursorSpr) to member "southeast"
  66.     else
  67.       set the member of sprite(cursorSpr) to member "east"
  68.     end if
  69.     
  70.   else
  71.     
  72.     if vert < -5 then
  73.       set the member of sprite(cursorSpr) to member "north"
  74.     else if vert > 5 then
  75.       set the member of sprite(cursorSpr) to member "south"
  76.     else  
  77.       set the member of sprite(cursorSpr) to member "stop"
  78.       set drop = FALSE
  79.     end if
  80.     
  81.   end if
  82.   
  83.   set the loc of sprite cursorSpr to mouseP
  84.   
  85.   -- little droplets
  86.   
  87.   repeat with a = 1 to count(drops)
  88.     set doMe = getAt(drops, a)
  89.     check doMe
  90.   end repeat  
  91.   
  92.   if random(2) = 2 AND drop then
  93.     repeat with a = 1 to count(drops)
  94.       set doMe = getAt(drops, a)
  95.       if not(the pActive of doMe) then
  96.         drop doMe, cursorSpr
  97.         exit repeat
  98.       end if
  99.     end repeat
  100.   end if 
  101.   
  102.   set oldMouseP = point(the mouseH, the mouseV)
  103.   
  104.   
  105.   -- Animation loops
  106.   set animLoop = TRUE
  107.   
  108.   repeat with i = 1 to count(animate)
  109.     set doMe = getAt(animate, i)
  110.     animLoop doMe
  111.   end repeat
  112.   
  113.   set animLoop = FALSE
  114.   
  115.   set gravitate = TRUE
  116.   
  117.   if count(gravite) > 0 then
  118.     repeat with x = 1 to count(gravite)
  119.       set doMe = getAt(gravite, x)
  120.       gravitate doMe 
  121.     end repeat
  122.   end if
  123.   
  124.   set gravitate = FALSE
  125.   
  126. end
  127.  
  128.  
  129. on exitFrame
  130.   go to the frame
  131. end
  132.